package net.pixlib.sfe.event 
{
	import net.pixlib.events.BasicEvent;

	import flash.events.Event;

	/**
	 * @author Romain Ecarnot
	 */
	public class UnicodeTableEvent extends BasicEvent 
	{
		//--------------------------------------------------------------------
		// Event types
		//--------------------------------------------------------------------
		
		/**
		 * Defines the value of the <code>type</code> property of the event 
		 * object for a <code>onUpdateUnicodeTable</code> event.
		 * 
		 * <p>The properties of the event object have the following values:</p>
	     * <table class="innertable">
	     *     <tr><th>Property</th><th>Value</th></tr>
	     *     <tr>
	     *     	<td><code>type</code></td>
	     *     	<td>Dispatched event type</td>
	     *     </tr>
	     *     
	     *     <tr><th>Method</th><th>Value</th></tr>
	     *     <tr>
	     *     	<td><code>getTable()</code>
	     *     	</td><td>The unicode table target instance</td>
	     *     </tr>
	     * </table>
	     * 
		 * @eventType onUpdateUnicodeTable
		 */
		public static const onUpdateUnicodeTableEVENT : String = "onUpdateUnicodeTable";
		
		
		//--------------------------------------------------------------------
		// Public API
		//--------------------------------------------------------------------
		
		/**
		 * Creates a new <code>UnicodeTableEvent</code> instance.
		 * 
		 * @param	type	name of the event type
		 * @param	labels	target of this event
		 */	
		public function UnicodeTableEvent(eventType : String, labels : Array = null)
		{
			super(eventType, labels);
		}
		
		/**
		 * Returns the <code>unicode table labels</code> object carried by event.
		 * 
		 * @return	the <code>unicode table labels</code> object carried by event.
		 */
		public function getTable() : Array
		{
			return getTarget() as Array;
		}
		
		/**
		 * Clone the event.
		 * 
		 * @return	a clone of the event
		 */
		override public function clone() : Event
		{
			return new UnicodeTableEvent(type, getTable());
		}
	}
}
